﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Atendimento.Master" AutoEventWireup="true" Theme="Adm" CodeBehind="ConsultaAgenda.aspx.cs" Inherits="PROAD.atendimento.Consulta.ConsultaAgenda" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="IncludeHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="IncludeTitulo" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="IncludeCaminho" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="IncludeConteudo" runat="server">
    
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
    <asp:HiddenField ID="hidCodAgenda" runat="server" />
    <asp:HiddenField ID="hidQualEquipe" runat="server" />

    <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
        
        <table width="100%">
            
            <tr>
                <td valign="top" width="100%">
                    <telerik:RadDockZone runat="server" ID="RadZoneEquipe1" MinHeight="100" Width="99%" BorderWidth="0">
                        <telerik:RadDock runat="server" ID="RadEquipe1" CssClass="Dock" EnableRoundedCorners="false" EnableAnimation="true" EnableDrag="true">
                            <Commands>
                                <telerik:DockExpandCollapseCommand />
                            </Commands>
                            <ContentTemplate>
                                <asp:HiddenField ID="HidCodEsquipe1" runat="server" />
                                <table width="100%">
                                    <tr>
                                        <td valign="top" width="250px">
                                            <asp:Calendar ID="CalendarioEs1" runat="server" 
                                                onselectionchanged="CalendarioEs1_SelectionChanged" 
                                                ondayrender="CalendarioEs1_DayRender"></asp:Calendar>
                                        </td>
                                        <td valign="top">
                                            <asp:GridView ID="AgendaEs1" SkinID="GridAdm" runat="server" 
                                                AutoGenerateColumns="false" 
                                                EmptyDataText="Não há agenda para a data selecionada!" 
                                                onrowcommand="AgendaEs1_RowCommand">
                                                <HeaderStyle HorizontalAlign="Left" />
                                                <Columns>
                                                    <asp:BoundField DataField="DT_AGENDA" HeaderText="DATA" />
                                                    <asp:BoundField DataField="NO_NOME" HeaderText="USUÁRIO" />
                                                    <asp:TemplateField HeaderText="Atender">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbAtender" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Atender"> <center><img src="../../common/imagem_sis/imagem_sis/editar.png" alt="Atender" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Remarcar">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbRemarcar" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Remarcar"> <center><img src="../../common/imagem_sis/imagem_sis/transfer.png" alt="Remarcar" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Cancelar">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbCancelar" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Cancelar"> <center><img src="../../common/imagem_sis/imagem_sis/excluir.png" alt="Cancelar" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                </table>
                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                    
                </td>                
            </tr>

            <tr>
                <td valign="top" width="50%">
                    <telerik:RadDockZone runat="server" ID="RadZoneEquipe2" MinHeight="100" Width="99%" BorderWidth="0">
                        <telerik:RadDock runat="server" ID="RadEquipe2" CssClass="Dock" EnableRoundedCorners="false" EnableAnimation="true" EnableDrag="true">
                            <Commands>
                                <telerik:DockExpandCollapseCommand />
                            </Commands>
                            <ContentTemplate>
                                <asp:HiddenField ID="HidCodEsquipe2" runat="server" />
                                <table width="100%">
                                    <tr>
                                        <td valign="top" width="250px">
                                            <asp:Calendar ID="CalendarioEs2" runat="server" 
                                                onselectionchanged="CalendarioEs2_SelectionChanged" 
                                                ondayrender="CalendarioEs2_DayRender"></asp:Calendar>
                                        </td>
                                        <td valign="top">
                                            <asp:GridView ID="AgendaEs2" SkinID="GridAdm" runat="server" AutoGenerateColumns="false" EmptyDataText="Não há agenda para a data selecionada!" onrowcommand="AgendaEs2_RowCommand">
                                                <HeaderStyle HorizontalAlign="Left" />
                                                <Columns>
                                                    <asp:BoundField DataField="DT_AGENDA" HeaderText="DATA" />
                                                    <asp:BoundField DataField="NO_NOME" HeaderText="USUÁRIO" />
                                                    <asp:TemplateField HeaderText="Atender">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbAtender" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Atender"> <center><img src="../../common/imagem_sis/imagem_sis/editar.png" alt="Atender" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Remarcar">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbRemarcar" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Remarcar"> <center><img src="../../common/imagem_sis/imagem_sis/transfer.png" alt="Remarcar" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Cancelar">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbCancelar" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Cancelar"> <center><img src="../../common/imagem_sis/imagem_sis/excluir.png" alt="Cancelar" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                </table>

                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                </td>                
            </tr>

            <tr>
                <td valign="top" width="50%">
                    <telerik:RadDockZone runat="server" ID="RadZoneEquipe3" MinHeight="100" Width="99%" BorderWidth="0">
                        <telerik:RadDock runat="server" ID="RadEquipe3" Title="Agenda Equipe 3" CssClass="Dock" EnableRoundedCorners="false" EnableAnimation="true" EnableDrag="true">
                            <Commands>
                                <telerik:DockExpandCollapseCommand />
                            </Commands>
                            <ContentTemplate>
                                <asp:HiddenField ID="HidCodEsquipe3" runat="server" />
                                <table width="100%">
                                    <tr>
                                        <td valign="top" width="250px">
                                            <asp:Calendar ID="CalendarioEs3" runat="server" 
                                                onselectionchanged="CalendarioEs3_SelectionChanged" 
                                                ondayrender="CalendarioEs3_DayRender"></asp:Calendar>
                                        </td>
                                        <td valign="top">
                                            <asp:GridView ID="AgendaEs3" SkinID="GridAdm" runat="server" AutoGenerateColumns="false" EmptyDataText="Não há agenda para a data selecionada!" onrowcommand="AgendaEs3_RowCommand">
                                                <HeaderStyle HorizontalAlign="Left" />
                                                <Columns>
                                                    <asp:BoundField DataField="DT_AGENDA" HeaderText="DATA" />
                                                    <asp:BoundField DataField="NO_NOME" HeaderText="USUÁRIO" />
                                                    <asp:TemplateField HeaderText="Atender">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbAtender" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Atender"> <center><img src="../../common/imagem_sis/imagem_sis/editar.png" alt="Atender" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Remarcar">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbRemarcar" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Remarcar"> <center><img src="../../common/imagem_sis/imagem_sis/transfer.png" alt="Remarcar" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Cancelar">
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lkbCancelar" runat="server"   CommandArgument='<%# Eval("CO_AGENDA") %>' CommandName="Cancelar"> <center><img src="../../common/imagem_sis/imagem_sis/excluir.png" alt="Cancelar" border="0"  /></center></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </td>
                                    </tr>
                                </table>

                            </ContentTemplate>
                        </telerik:RadDock>
                    </telerik:RadDockZone>
                </td>                
            </tr>
            
        </table>
    
    </telerik:RadDockLayout>


    <!-- Área de Validação abaixo -->
    <div style="display:none;">
        <asp:HyperLink ID="linkMsn" runat="server">HyperLink</asp:HyperLink>
    </div>
    <asp:ModalPopupExtender ID="ModalPopupMsn" runat="server" 
        BackgroundCssClass="modalBackground" CancelControlID="btnCancela" 
        PopupControlID="PainelMsn" TargetControlID="linkMsn">
    </asp:ModalPopupExtender>
    <asp:Panel ID="PainelMsn" runat="server" CssClass="modalPopup" 
        Style="display:none" Width="350px">
        <asp:Panel ID="Panel2" runat="server" 
            Style="border-bottom:solid 1px Gray;height:25px;">
            <div>
                <h1 
                    style="line-height: 25px; text-align: center; margin: 0px 0px 0px 0px; vertical-align: bottom;
                padding: 0px 0px 0px 0px; font-size: 14px; font-family: Verdana; background-color: #A4CFA2;">
                    <asp:Label ID="txtTituloMsn" runat="server"></asp:Label>
                </h1>
            </div>
        </asp:Panel>
        <div>
            <br />
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%; text-align: center;">
                <asp:Label ID="txtTextoMsn" runat="server"></asp:Label>
            </h2>
            <br />
            <table width="100%">
                <tr>
                    <td align="center">
                                 
                        <asp:Button ID="btnCancela" runat="server" Text="OK" />
                                 
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
    <!-- Final Área de Validação -->

    <!-- Painel Remarcar -->
    <div style="display:none;">
        <asp:HyperLink ID="linkPanelRemarcar" runat="server">HyperLink</asp:HyperLink>
    </div>
    <asp:ModalPopupExtender ID="ModalRemarcar" runat="server" 
        BackgroundCssClass="modalBackground" CancelControlID="btnCancelarRemarca" 
        PopupControlID="PainelRemarcar" TargetControlID="linkPanelRemarcar">
    </asp:ModalPopupExtender>
    <asp:Panel ID="PainelRemarcar" runat="server" CssClass="modalPopup" 
        Style="display:none" Width="350px">
        <asp:Panel ID="Panel3" runat="server" 
            Style="border-bottom:solid 1px Gray;height:25px;">
            <div>
                <h1 
                    style="line-height: 25px; text-align: center; margin: 0px 0px 0px 0px; vertical-align: bottom;
                padding: 0px 0px 0px 0px; font-size: 14px; font-family: Verdana; background-color: #A4CFA2;">
                    Remarcação de Agenda
                </h1>
            </div>
        </asp:Panel>
        <div>
            <br />
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%; text-align: center;">
                Favor escolher nova data abaixo e clicar em salvar!
            </h2>
            <br />
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%;">
                Nova Data
            </h2>
            <asp:TextBox ID="txtDtRemancaAgenda" runat="server"></asp:TextBox>
            <asp:Image ID="imgCalendar" ImageUrl="~/common/imagem_sis/imagem_sis/calendario.png" runat="server" />
            <asp:CalendarExtender ID="CalendarExtenderRemancaAgenda" Format="dd/MM/yyyy" TargetControlID="txtDtRemancaAgenda" PopupButtonID="imgCalendar"  runat="server">
            </asp:CalendarExtender>
            <asp:MaskedEditExtender ID="MaskedEditExtender1" runat="server"
            TargetControlID="txtDtRemancaAgenda" 
            Mask="99/99/9999"
            MaskType="Date"/>
            <br />
            <table width="100%">
                <tr>
                    <td align="center">                        
                        <asp:Button ID="btnRemarcarAgenda" runat="server" Text="Salvar" 
                            onclick="btnRemarcarAgenda_Click" />         
                        <asp:Button ID="btnCancelarRemarca" runat="server" Text="Cancelar" />                                 
                    </td>
                </tr>
            </table>
            <br />
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%;color:Red;">
                <asp:Label ID="lblErroRemarcacao" runat="server" ></asp:Label>
            </h2>
        </div>
    </asp:Panel>
    <!-- Final Painel Remarcar -->

    <!-- Painel Cancelar -->
    <div style="display:none;">
        <asp:HyperLink ID="linkCancelarAgenda" runat="server">HyperLink</asp:HyperLink>
    </div>
    <asp:ModalPopupExtender ID="ModalCancelarAgenda" runat="server" 
        BackgroundCssClass="modalBackground" CancelControlID="btnCancelarCancelar" 
        PopupControlID="PainelCancelarAgenda" TargetControlID="linkCancelarAgenda">
    </asp:ModalPopupExtender>
    <asp:Panel ID="PainelCancelarAgenda" runat="server" CssClass="modalPopup" 
        Style="display:none" Width="350px">
        <asp:Panel ID="Panel4" runat="server" 
            Style="border-bottom:solid 1px Gray;height:25px;">
            <div>
                <h1 
                    style="line-height: 25px; text-align: center; margin: 0px 0px 0px 0px; vertical-align: bottom;
                padding: 0px 0px 0px 0px; font-size: 14px; font-family: Verdana; background-color: #A4CFA2;">
                    Cancelamento de Agenda
                </h1>
            </div>
        </asp:Panel>
        <div>
            <br />
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%; text-align: center;">
                Favor digite uma observação e clicar em Cancelar Agenda!
            </h2>
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%;">
                Observação do cancelamento
            </h2>
            <center>
            <asp:TextBox ID="txtObsCancelaAgenda" Width="340px" TextMode="MultiLine" runat="server"></asp:TextBox>
            </center>
            <br />
            <table width="100%">
                <tr>
                    <td align="center">                        
                        <asp:Button ID="btnCancelarAgenda" runat="server" Text="Cancelar Agenda" 
                            onclick="btnCancelarAgenda_Click" />         
                        <asp:Button ID="btnCancelarCancelar" runat="server" Text="Desistir" />                                 
                    </td>
                </tr>
            </table>
            <br />
            <h2 style="margin: 0px 0px 0px 0px; font-family: Verdana; font-size: 11px; font-weight: normal;
            line-height: 25px; width: 100%;color:Red;">
                <asp:Label ID="lblErroCancelamento" runat="server" ></asp:Label>
            </h2>
        </div>
    </asp:Panel>
    <!-- Final Painel Cancelar -->

    </ContentTemplate>
    </asp:UpdatePanel>

</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="IncludeRodape" runat="server">
</asp:Content>
